package com.baaio.parse;

import java.util.ArrayList;
import java.util.Vector;

public class BaaioDataSort
{

	public static Vector<String> getSortVector(Vector<String> vector)
	{

		for (int i = 0; i < vector.size() - 1; i++)
		{
			for (int j = 1; j < vector.size() - i; j++)
			{
				try
				{
					Integer A = new Integer(vector.get(j - 1));
					Integer B = new Integer(vector.get(j));
					if ((A).compareTo(B) > 0)
					{ // 比较两个整数的大小
						vector.set((j - 1), vector.get(j));
						vector.set(j, A.toString());
					}
				}
				catch (Exception e)
				{
					if ((vector.get(j - 1)).compareTo(vector.get(j)) > 0)
					{ // 比较两个整数的大小
						vector.set((j - 1), vector.get(j));
						vector.set(j, vector.get(j));
					}
				}

			}
		}
		return vector;
	}

	public static ArrayList<Object> changeToList(Object[] b)
	{

		ArrayList<Object> list = new ArrayList<Object>();
		for (int i = 0; i < b.length; i++)
		{
			list.add(b[i]);
		}

		return list;
	}
}
